﻿#light

open System

// F# for Scientists
// Section 3.2

// Initialize arrays (note the [|...|] syntax)
let a = [| 1; 2 |]
let b = [| 3; 4; 5 |]
let c = [| 6; 7; 9 |]

// Index into the array
printfn "b.[1]=%d" b.[1]

// Assign a value to an array element
c.[2] <- 8
printfn "c=%A" c

// IndexOutOfRangeException!
//try c.[3] <- 8 
//with System.IndexOutOfRangeException e -> printfn "Index is out of range!" 


// Appending arrays
printfn "Array.append a b = %A" (Array.append a b)

// Array concatenation
printfn "Array.concat [a; b; c] = %A" (Array.concat [a; b; c])

